import 'package:f_base_one/components/shop_list.dart';
import 'package:flutter/material.dart';

class MyApp16 extends StatelessWidget {
  const MyApp16({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: const Text('ListView组件builder函数的使用'),
          backgroundColor: Colors.red,
        ),
        body: ListView.separated(
            itemBuilder: (BuildContext context, int index) {
              return ShopList();
            },
            //设置列表的分割线
            separatorBuilder: (BuildContext context, int index) {
              return Container(
                padding: const EdgeInsets.all(10),
                child: const Divider(
                  height: 1,
                  color: Color.fromARGB(255, 123, 237, 138),
                ),
              );
            },
            // 列表展示的数量
            itemCount: 20));
  }
}
